package com.tjb.utils.strategy;

public class SingletonLazy{

    private static SingletonLazy singletonLazy = null;

    private SingletonLazy(){}

    public static SingletonLazy getInstance(){
        if (singletonLazy == null){
            //同步代码块，保证在多线程的情况下，每个时间内，有且仅有一人执行
            synchronized (SingletonLazy.class){
                singletonLazy = new SingletonLazy();
            }
        }
        return singletonLazy;
    }
}